Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model label refactor #322

Merged
3 commits merged into from
Mar 16, 2011
Merged

Conversation

wolframarnold
Copy link
Contributor

Patch as per suggestions in: #319

The gist of it is that I've removed Labelable from the Sections modules and added the methods to the model configuration. You can now set the model's label and also object_label at the model configuration level like so:

RailsAdmin.config do |config|
  config.model Team do
    label "List of teams"
  end
end

It's no longer possible to override the model's name for each section individually, but that feature was never really fully implemented in the first place, in the sense that many display outputs were using the wrong labels (see issue #319).

I've also updated the Readme accordingly as well as the specs -- all passing.

I've updated the gem's version to 0.0.2, in a spearate commit, as this is an API breaking change. The methods "lavel_for_navigation", "label_for_list", etc. are no longer supported. I've left them in, they print a warning but they're effectively no-ops.

Wolfram Arnold added 3 commits March 15, 2011 17:49
…adminteam#319

The model label is now configurable at the model level only, and is no longer configurable
at the section level (list, navigate, update,...), as this was considered overkill.
This refactoring was in part motivated by issue railsadminteam#319 which reported that display of labels was very inconsistent across
various screens, and the label configuration, if given, was not consistently effective.
The Labelable module was removed, and the methods model into config/model.rb
All references to label across the code have been updated to use the model configuration.
Specs updated and passing. Readme also updated accordingly.
…are no longer supported in sections, only at the model level.
@kaapa
Copy link
Collaborator

kaapa commented Mar 16, 2011

+1

These changes simplify unnecessary complexity of label configuration and if this patch is accepted I'd like to do same kind of refactoring with the RailsAdmin::Config::Hideable module which has been discussed here.

PS. I think 0.0.2 could consist of this patch, Hideable refactoring and jQuery branch merge to master.

@sferik
Copy link
Collaborator

sferik commented Mar 16, 2011

Merged into master.

Technically, if we're following Semantic Versioning (as we should be), backwards-incompatible API changes should require a minor version bump (0.1.0) but I'm not sure this matters so much, since a real rails_admin gem has never been released.

@wolframarnold
Copy link
Contributor Author

Thanks for accepting the patch. When are you planning to release a "real gem"? The version on rubygems (0.0.0) is woefully outdated, and I also think the project is definitely in good enough shape to be released as version 0.0.2 now.

@sferik
Copy link
Collaborator

sferik commented Mar 16, 2011

I'd like to hold off releasing rails_admin as a gem until the project is a bit more stable. Since Rails 3 uses bundler, it makes it easy to add a dependency that points to the git repo.

@wolframarnold
Copy link
Contributor Author

Fair enough. It seems pretty stable from our end here, and we've been
through other CMS/admin like solutions that had much higher revision numbers
and were much less usable/stable. My 2 cents.

Great work on Rails Admin by the way. It's a well written piece of code and
it's been a joy to work on it.

Best,
Wolf

On Wed, Mar 16, 2011 at 2:54 PM, sferik <
[email protected]>wrote:

I'd like to hold off releasing rails_admin as a gem until the project is a
bit more stable. Since Rails 3 uses bundler, it makes it easy to add a
dependency that points to the git repo.

Reply to this email directly or view it on GitHub:
#322 (comment)

www.RubyFocus.biz --- San Francisco --- direct: 650-576-9048

@sferik sferik closed this Mar 19, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants